package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhStoreCategoryMapper;
import com.ruoyi.zsyh.domain.ZsyhStoreCategory;
import com.ruoyi.zsyh.service.IZsyhStoreCategoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 维修店服务类目Service业务层处理
 * 
 * @author yuexl
 * @date 2022-02-22
 */
@Service
public class ZsyhStoreCategoryServiceImpl implements IZsyhStoreCategoryService 
{
    @Autowired
    private ZsyhStoreCategoryMapper zsyhStoreCategoryMapper;

    /**
     * 查询维修店服务类目
     * 
     * @param id 维修店服务类目ID
     * @return 维修店服务类目
     */
    @Override
    public ZsyhStoreCategory selectZsyhStoreCategoryById(String id)
    {
        return zsyhStoreCategoryMapper.selectZsyhStoreCategoryById(id);
    }

    /**
     * 查询维修店服务类目列表
     * 
     * @param zsyhStoreCategory 维修店服务类目
     * @return 维修店服务类目
     */
    @Override
    public List<ZsyhStoreCategory> selectZsyhStoreCategoryList(ZsyhStoreCategory zsyhStoreCategory)
    {
        return zsyhStoreCategoryMapper.selectZsyhStoreCategoryList(zsyhStoreCategory);
    }

    /**
     * 新增维修店服务类目
     * 
     * @param zsyhStoreCategory 维修店服务类目
     * @return 结果
     */
    @Override
    public int insertZsyhStoreCategory(ZsyhStoreCategory zsyhStoreCategory)
    {
        zsyhStoreCategory.setCreateTime(DateUtils.getNowDate());
        return zsyhStoreCategoryMapper.insertZsyhStoreCategory(zsyhStoreCategory);
    }

    /**
     * 修改维修店服务类目
     * 
     * @param zsyhStoreCategory 维修店服务类目
     * @return 结果
     */
    @Override
    public int updateZsyhStoreCategory(ZsyhStoreCategory zsyhStoreCategory)
    {
        zsyhStoreCategory.setUpdateTime(DateUtils.getNowDate());
        return zsyhStoreCategoryMapper.updateZsyhStoreCategory(zsyhStoreCategory);
    }

    /**
     * 删除维修店服务类目对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhStoreCategoryByIds(String ids)
    {
        return zsyhStoreCategoryMapper.deleteZsyhStoreCategoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除维修店服务类目信息
     * 
     * @param id 维修店服务类目ID
     * @return 结果
     */
    @Override
    public int deleteZsyhStoreCategoryById(String id)
    {
        return zsyhStoreCategoryMapper.deleteZsyhStoreCategoryById(id);
    }

    public int deleteZsyhStoreCategoryByStoreId(String id){
        return zsyhStoreCategoryMapper.deleteZsyhStoreCategoryByStoreId(id);
    }

    public Integer insertZsyhStoreCategoryBatch(List<ZsyhStoreCategory> list){
        return zsyhStoreCategoryMapper.insertZsyhStoreCategoryBatch(list);
    }
}
